package Factory;

public class PearFactory extends FruitFactory{
    public  final  static String BIGPEAR="apple";
    public  final  static String SMALLPEAR="pear";

    Fruit createFruit(String type)
    {
        switch (type)
        {
            case BIGPEAR:
                return new BigPear();
            case SMALLPEAR:
                return new SmallPear();
            default:
                //不需要break了？？？？
                throw new IllegalArgumentException("暂时没有这种水果");
        }
    }
}
